<extend name="template/base_index" />


<block name="area_header">

</block>

<block name="area_body">
	{:W('Menus/topbar')}
	<div class="admin-main container-fluid">
		{:W('Menus/left')}
		<div class="admin-main-content">
			{:W('Menus/breadcrumb')}
			<!-- 过滤\查询按钮 -->
			<div class="filter-controls">
				<!-- 日期查询 -->
				<form action="{:U('Admin/Banners/index')}" method="post" class="form-inline searchForm">
					<label>Banners类别</label>
          <select class="form-control input-short input-sm select_type" name="type">
						<volist name="banners_type" id="vo">
						<option value="{$vo.id}">{$vo.id} - {$vo.name}</option>
						</volist>
          </select>
				</form>
			</div>
			<!-- 操作按钮 -->
			<div class="btn-controls">
				<a class="btn btn-primary btn-sm" href="{:U('Admin/Banners/add',array('type'=>$type))}"><i class="fa fa-plus"></i>{:L('BTN_ADD')}</a>
				<a href="{:U('Admin/Banners/delete_all')}" class="btn btn-danger btn-sm ajax-post confirm" target-form="delete-banners">删除选中项</a>
			</div>

			<table class="table table-striped table table-hover delete-banners table-condensed">
				<thead>
				<tr>
					<th>
						<input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />
					</th>
					<th>ID</th>
					<th>
						图片地址
					</th>
					<th>
						跳转链接
					</th>
					<th>
						类别
					</th>
					<th>
						序号
					</th>
					<th>
						添加时间
					</th>
					<th>
						操作
					</th>
				</tr>
				</thead>
				<tbody>
				<empty name="list">
					<tr>
						<td colspan="7" class="text-center">{:L('NO_DATA')}</td>
					</tr>
					<else/>
					<volist name="list" id="vo">
						<tr>
							<td>
								<input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" /></td>
							<td>{$vo.id}</td>
							<td><a href="{:C('PICTURE_REMOTE_URL')}{$vo['img']}&size=60" target="_blank" title="点击查看原图"><img style="height:50px;" src="{:C('PICTURE_REMOTE_URL')}{$vo['img']}&size=60" alt="{$vo.url}" /></a>
							</td>
							<td>
								<a href="{$vo['url']}" target="_blank" title="点击查看">{$vo.url}</a>
							</td>
							<td>
								{$vo.position_name}
							</td>
							<td>
								{$vo.sort}
							</td>
							<td>
								{$vo.createtime|date='Y-m-d h:i:s',###}
							</td>
							<td>
								<a href="{:U('Admin/Banners/edit',array('id'=>$vo['id']))}" class="btn btn-sm btn-default"><i class="fa fa-edit"></i>编辑</a>

								<a href="{:U('Admin/Banners/delete',array('id'=>$vo['id']))}" class="ajax-get confirm btn btn-sm btn-danger"><i class="fa fa-trash"></i>删除</a>
							</td>
						</tr>

					</volist>
				</empty>
				</tbody>
			</table>
			<div>{$show}</div>
		</div>

	</div>
	<!-- END admin-main-content -->
	</div>
	<!-- END admin-main-->
</block>

<block name="area_footer">
<script type="text/javascript">
$(function(){
	$('.select_type').val({$type});
	$("select[name='type']").change(function(){
	    $('.searchForm').submit();
	});
});
</script>
</block>